package com.isoft.illustrationsdraw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.isoft.illustrationsdraw.entity.Follow;
import com.isoft.illustrationsdraw.mapper.FollowMapper;
import com.isoft.illustrationsdraw.service.FollowService;
import org.springframework.stereotype.Service;

@Service
public class FollowServiceImpl extends ServiceImpl<FollowMapper, Follow> implements FollowService {

    @Override
    public Follow findFollow(Follow follow) {
        QueryWrapper<Follow> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("follower_id", follow.getFollowerId()).eq("followed_id", follow.getFollowedId());
        return getOne(queryWrapper);
    }

}
